#include <bits/stdc++.h>
using namespace std;
#define PI 3.1415926
#define   SQUARE(x) ((x)*(x))
//double SQUARE(double x) { return x*x;}

int cnt, ans;

void w1()
{
	int m, n, x,y;
	scanf("%d", &n);
	bool isPreOk = false;
 	for(int i=0; i<n; i++){
		scanf("%d%d", &x, &y);
		if(90<=x && x<=140 && 60<=y && y<=90){
			cnt++;
			if(ans < cnt) ans = cnt;
			isPreOk = true;
		}
		else{
			isPreOk = false;
			cnt = 0;
		}
 	}
	printf("%d", ans);

}

int main()
{
	w1();
  return 0;
}
